#ifndef FILE_TIEMPO_INCLUDED
#define FILE_TIEMPO_INCLUDED

#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <time.h>

#define SECONDS_IN_A_DAY (60*60*24)  

 /*
  * Obtains current time value, as seconds since 1970.
  */
	time_t getCurrentTime();
	
/* 
 * Obtains the time value for today at 00:00h (as seconds since 1970).
 */
	time_t getToday();	

/*
 * Gets the time value of "days" days before today at 00:00h
 * Returns:
 *    time value corresponding to today at 00:00h if days ==0 --> the same as getToday()
 *    time value corresponding to yesterday at 00:00h if days ==1
 *    time value corresponding to x days before at 00:00h if days ==x
 */
	time_t getStartTimeDaysBefore(int days);

/*
 * Calls to ctime, but skipping the last '\n' char.
 * Therefore it just returs a formatted char * value corresponding
 * to parameter t.
 * Note, a call to free is mandatory after using the returned value.
 */
	char *getTimeAsString(time_t t);	
	
#endif


